package vo;

import javax.persistence.*;

@Entity
@NamedQueries({ 
	@NamedQuery(name = "SourceCategory.findAll", query = "select e from SourceCategory e where source.type!='METASE' and source.type!='WEIBO'"),
	@NamedQuery(name = "SourceCategory.findByName", query = "select e from SourceCategory e where name=? and source.type!='METASE' and source.type!='WEIBO'"),
	@NamedQuery(name = "SourceCategory.findByNameSourceId", query = "select e from SourceCategory e where name=? and source.id=? and source.type!='METASE' and source.type!='WEIBO'"),
	@NamedQuery(name = "SourceCategory.findTotalCount", query = "select count(*) from SourceCategory t where source.type!='METASE' and source.type!='WEIBO'")
})
@Table(name = "source_category")
public class SourceCategory extends BaseEntity {
	@Column(name = "name")
	private String name;

	@JoinColumn(name = "source_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private Source source;

	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Source getSource() {
		return source;
	}

	public void setSource(Source source) {
		this.source = source;
	}


}
